﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace XqWebSite
{
    public partial class WebForm24 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)//判断是否回发
            {
                GetDate();//调用函数
            }
        }
        private void GetDate()
        {
            DataSet ds = DBHelper.GetDataSet("select * from WeiXiuDan");
            this.GridView1.DataSource = ds.Tables[0];//获取数据并绑定到控件 
            this.GridView1.DataBind();
        }

        protected void But_Ss_Click(object sender, EventArgs e)
        {
            string SQL = "select * from WeiXiuDan where 1=1";
            if (!string.IsNullOrEmpty(Tex_shr.Text))
            {
                SQL = SQL + " and AdminID ='" + Tex_shr.Text + "'";
            }
            if (!string.IsNullOrEmpty(Tex_bxr.Text))
            {
                SQL = SQL + " and WeiXiuRenYuanID ='" + Tex_bxr.Text + "'";
            }

            DataSet ds = DBHelper.GetDataSet(SQL);
            this.GridView1.DataSource = ds.Tables[0];//获取数据并绑定到控件 
            this.GridView1.DataBind(); 
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void But_xg_Click(object sender, EventArgs e)
        {
            Response.Redirect("BaoxiuShenheSh.aspx");
        }
    }
   }
